resist the urge

Translations
сопротивляться желанию
He tried to resist the urge to eat the whole cake.
Он пытался сопротивляться желанию съесть весь торт.
Definitions
To consciously avoid giving in to a strong desire or impulse to do something, often because it may lead to negative consequences.